<template>
  <div class="hm-header">
    <div class="nav-left" v-if="showBack" @click="$emit('clickLeft')">&lt;</div>
    <div class="nav-title"><slot>导航</slot></div>
    <div class="nav-right"><slot name="nav-right"></slot></div>
  </div>
</template>

<script>
export default {
  props: {
    showBack: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style lang="less" scoped>
.hm-header {
  width: 100%;
  height: 44px;
  line-height: 44px;
  background-color: #fff;
  display: flex;

  .nav-left {
    padding: 0px 5px;
    cursor: pointer;
  }
  .nav-title {
    flex: 1;
    text-align: center;
  }
  .nav-right {
    padding: 0px 5px;
  }
}
</style>
